/*
 * Copyright (c) 2014 laidian. All Rights Reserved.
 * @author yaoyuming
 * @date  2020-06-03 18:01
 */
package com.yao.common.config;

import java.util.ArrayList;
import java.util.List;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.yao.common.filter.LocalDateTimeFilter;

import cn.hutool.core.lang.Console;

/**
 * @author yaoyuming
 * @date 2020/06/03 18:01
 */

@Configuration
public class FilterRegistrationConfig {


    @Bean
    public FilterRegistrationBean addAuthorizeFilter(){

        Console.log("0-p---------------------------");
        FilterRegistrationBean registrationBean = new FilterRegistrationBean(new LocalDateTimeFilter());

        List<String> urlPatterns = new ArrayList<>();
        urlPatterns.add("/**");
        registrationBean.setUrlPatterns(urlPatterns);

        return registrationBean;
    }
}